import xadmin
from common.models import *


class DepartmentXadmin(object):
    list_display = ['id', 'name', 'parent_department']
    list_display_links = ['name']


class UserXadmin(object):
    list_display = ['id', 'username', 'email', 'first_name', 'gender', 'department']
    list_display_link = ['id', 'username']
    editor_fields = ['email', 'gender']


xadmin.site.register(Department, DepartmentXadmin)
xadmin.site.unregister(User)
xadmin.site.register(User, UserXadmin)
